/**
 * 
 */
package com.jframework.module.usps.beans.rates;

import java.util.ArrayList;
import java.util.List;

import com.jframework.module.usps.beans.USPSBaseRequestObject;


/**
 * @author AJain
 *
 */
public class IntlRateRequest extends USPSBaseRequestObject 
{
    
    private List list = null;

    public IntlRateRequest()
    {
	
    }
    
    public IntlRateRequest(String user_id)
    {
	this.setUSERID(user_id);
    }
       
    public IntlRateRequestPackage[] getPackage()
    {
	if (null == this.list) return null;
	IntlRateRequestPackage[] packageArray = new IntlRateRequestPackage[list.size()];
        return (IntlRateRequestPackage[]) list.toArray(packageArray);
    }
    
    public boolean addPackage(IntlRateRequestPackage aPackage)
    {
	if (null == this.list) this.list = new ArrayList();
        if (!list.contains(aPackage))
	  return list.add(aPackage);
        
        return false;
    }
    
    public void setPackage(IntlRateRequestPackage[] packages)
    {
        if (null != packages)        
         for (int i=0; i < packages.length; i++)
         {
            this.addPackage(packages[i]);
         }
    }
    
    
}
